<!doctype html>
<html lang="en">

<head>
	<meta charset="UTF-8" />
	<title>北京循一堂健康管理有限公司</title>
	<link rel="stylesheet" href="../css/page.css" />
	<link rel="stylesheet" href="css/base.css" />
	<link rel="stylesheet" href="css/animate.css" />
	<link rel="stylesheet" href="css/jquery-ui.css" />
	<link rel="stylesheet" href="css/contextMenu/jquery.contextMenu.css" />
	<link rel="stylesheet" href="css/minAlert.css" />
	<link rel="stylesheet" href="css/main.css" />
	<link rel="stylesheet" href="css/uiKit.css" />
	<link rel="stylesheet" href="css/CEmojiEngine.css" />
	<link rel="stylesheet" href="css/rangeslider.css" />
	<link rel="stylesheet" href="css/pure-min.css">
	<link rel="stylesheet" href="css/whiteboard.css" />
    <link rel="stylesheet" href="../css/xxxx.css">
	<link href="../css/bootstrap.min.css" rel="stylesheet" type="text/css">
	<link href="../css/workdesk.css" rel="stylesheet" type="text/css">
    <link href="../plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" type="text/css">
    <link href="../plugins/bootstrap-datepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css">
	<link rel="icon" href="../images/icon.jpg" type="image/x-icon" />
	<link href="../js/ymPrompt/skin/simple/ymPrompt.css" rel="stylesheet" type="text/css">
</head>

<body>
	
	<script src="../js/jquery.min.js"></script>
	<script src="../js/bootstrap.min.js"></script>
    <script src="../plugins/select/js/bootstrap-select.min.js"></script>

    <script src="../plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="../plugins/bootstrap-table/bootstrap-table-zh-CN.min.js"></script>
	<script src="../js/ymPrompt/ymPrompt.js"></script>
    <script src="../plugins/bootstrap-datepicker/js/moment.js"></script>
    <script src="../plugins/bootstrap-datepicker/js/bootstrap-datetimepicker.min.js"></script>
	<script src="../js/jquery.SuperSlide.2.1.1.js" type="text/javascript" charset="utf-8"></script>
	<script src="../js/index.js"></script>
	<script type="text/javascript">
		$(function () {
			$(".tab").slide({ //切换新闻
				titCell: ".hd li",
				mainCell: ".bd",
				targetCell: ".more li",
				effect: "fade",
				autoPlay: false,
				trigger: "click",
				easing: "linear",
				delayTime: 0
			});

			$(".yylb .tab").slide({ //切换新闻
				titCell: ".hd li",
				mainCell: ".bd",
				targetCell: ".more li",
				effect: "fade",
				autoPlay: false,
				trigger: "click",
				easing: "linear",
				delayTime: 0
			});

		});
		$(function(){
						            $(".xyt_xl").click(function(){
						                $(".xyt_nav").show();  //隐藏
						            })					         
						            $(".xyt_nav").mouseover(function(){
						                $(".xyt_nav").show();  //显示
						            })
						            $(".xyt_nav").mouseout(function(){
						                $(".xyt_nav").hide();  //显示
						            })
						           	
						        })

		function ScrollImgLeft() {
			var speed = 50;
			var scroll_begin = document.getElementById("scroll_begin");
			var scroll_end = document.getElementById("scroll_end");
			var scroll_div = document.getElementById("scroll_div");
			scroll_end.innerHTML = scroll_begin.innerHTML;

			function Marquee() {
				if (scroll_end.offsetWidth - scroll_div.scrollLeft <= 0)
					scroll_div.scrollLeft -= scroll_begin.offsetWidth;
				else
					scroll_div.scrollLeft++;
			}
			var MyMar = setInterval(Marquee, speed);
			scroll_div.onmouseover = function () {
				clearInterval(MyMar);
			}
			scroll_div.onmouseout = function () {
				MyMar = setInterval(Marquee, speed);
			}
		}
	</script>
	<div class="header">
		<div class="container-im right-b clearfix">
			<div class="logo fl"><img src="../images/logo.jpg" /></div>

			<div class="center fl">
				<div style="width:96%;height:21px;margin:0 auto;white-space: nowrap;overflow:hidden;" id="scroll_div" class="scroll_div">
					<div id="scroll_begin">
						<a href="#" target="_blank"><i>·</i><span>请各位医生完善个人基本信息 <b>2018-07-26</b></span></a>
						<a href="#" target="_blank"><i>·</i><span>请各位医生完善个人基本信息 <b>2018-07-26</b></span></a>
						<a href="#" target="_blank"><i>·</i><span>请各位医生完善个人基本信息 <b>2018-07-26</b></span></a>
						<a href="#" target="_blank"><i>·</i><span>请各位医生完善个人基本信息 <b>2018-07-26</b></span></a>
					</div>
					<div id="scroll_end"></div>
				</div>
				<script type="text/javascript">
					ScrollImgLeft();
				</script>
			</div>

			<div class="data fr clearfix">
				<div class="tx">
					<img src="../images/logo.jpg" alt="" height="50" />
				</div>
				<div class="name">
					<p>欢迎胡凤亮医生<button class="name_button1" onclick="">退出登录</button></p>
					<button onclick="" id="name" class="xyt_xl">个人中心</button>
					
				</div>
				<div class="xyt_nav">
					<ul>
						<a href="../patientlibrary.html" target="_blank"><li>患者库</li></a>
						<a href="../appointlist.html" target="_blank"><li>预约列表</li></a>
						<a href="../workplan.html" target="_blank"><li>工作计划</li></a>
						<a href="../usercenter.html" target="_blank"><li>个人中心</li></a>
						<a href="../medicalservice.html" target="_blank"><li>药方维护</li></a>
					</ul>
				</div>

			</div>
		</div>
	</div>
	<div class="main clearfix">

	</div>
	<div class="bad-network hide tc radius5px" id="errorNetwork">已与服务器断开，请检查网络连接</div>
	<div class="wrapper box-sizing">
		<div class="content">
			<div class="left-panel radius5px" id="left-panel">
				<div class="hide loading" id="loading"></div>
				<div class="title">
					<img src="" alt="" width="56" height="56" class="radius-circle avatar" id="userPic" />
					<span id="userName-im">胡凤亮医生 &nbsp;</span>
					<!-- <span>
						<img src="images/pen.png" class="u-modify" id="showMyInfo">
					</span> -->
				</div>
				<div class="m-devices hide">正在使用循一堂web版</div>
				<!-- <div class="panel" id="switchPanel">
					<a class="box-sizing tc m-unread panel_tab cur" data-type="sessions">
						<span class="icon icon-session"></span>
						<b class="u-unread hide"> </b>
					</a>
					<a class="box-sizing tc panel_tab" data-type="friends">
						<span class="icon icon-friend"></span>
					</a>
					<a class="box-sizing tc panel_tab" data-type="teams">
						<span class="icon icon-team"></span>
					</a>
				</div> -->
				<div class="item" id="sessionsWrap" data-type="sessions">
					<!-- 最近联系人 -->
					<div class="list">
						<!-- <div class="m-panel">
							<div class="panel_item m-sysMsg" id="showNotice_temp">
								 <div class="panel_avatar">
									<img class="panel_image" src="images/notice.png" alt="消息中心" />
								</div> 
								<div class="panel_text">
									<p class="panel_single-row"><b>候诊列表</b></p>
								</div>
								<b class="count j-sysMsgCount hide"></b>
							</div>
						</div> -->
						<div id="sessions">
							<p>正在获取候诊人...</p>
							
						</div>
					</div>
				</div>
				<div class="item hide" id="friendsWrap" data-type="friends">
					<!-- 通讯录 -->
					<div class="list">
						<div class="m-panel">
							<div class="panel_item" id="addFriend">
								<div class="panel_avatar">
									<img class="panel_image" src="images/addFriend.png" alt="添加好友" />
								</div>
								<div class="panel_text">
									<p class="panel_single-row">添加好友</p>
								</div>
							</div>
							<div class="panel_item" id="showBlacklist">
								<div class="panel_avatar">
									<img class="panel_image" src="images/black.png" alt="黑名单" />
								</div>
								<div class="panel_text">
									<p class="panel_single-row">黑名单</p>
								</div>
							</div>
							<div class="panel_item" id="myPhone">
								<div class="panel_avatar">
									<img class="panel_image" src="images/myPhone.png" alt="我的手机" />
								</div>
								<div class="panel_text">
									<p class="panel_single-row">我的手机</p>
								</div>
							</div>
						</div>
						<div id="friends">
							<p>正在获取通讯录...</p>
						</div>
					</div>
				</div>
				<div class="item hide" id="teamsWrap" data-type="teams">
					<!-- 群 -->
					<div class="list">
						<div class="m-panel">
							<div class="panel_item" id="createTeam">
								<div class="panel_avatar">
									<img class="panel_image" src="images/addTeam.png" alt="创建讨论组" />
								</div>
								<div class="panel_text">
									<p class="panel_single-row">创建讨论组</p>
								</div>
							</div>
						</div>
						<div class="m-panel">
							<div class="panel_item" id="createAdvanceTeam">
								<div class="panel_avatar">
									<img class="panel_image" src="images/addTeam.png" alt="创建高级群" />
								</div>
								<div class="panel_text">
									<p class="panel_single-row">创建高级群</p>
								</div>
							</div>
						</div>
						<div class="m-panel">
							<div class="panel_item" id="searchAdvanceTeam">
								<div class="panel_avatar">
									<img class="panel_image" src="images/searchTeam.png" alt="搜索高级群" />
								</div>
								<div class="panel_text">
									<p class="panel_single-row">搜索高级群</p>
								</div>
							</div>
						</div>
						<div class="teams m-panel" id="teams">
						</div>
					</div>
				</div>
			</div>
			<div class="chatVernier" id="chatVernier">
				<span class="radius-circle hide"></span>
			</div>
			<div class="right-panel hide radius5px" id="rightPanel">
				<!-- 聊天面板 -->
				<div class="chat-box show-netcall-box" id="chatBox">
					<div class="title" id="chatTitle">
						<img src="" width="56" height="56" class="radius-circle img" id="headImg" />
						<span id="nickName"></span>
						<div class="cloudMsg tc radius4px" data-record-id="" id="cloudMsg">
							<i class="icon icon-team-info"></i>
							<p>云记录</p>
						</div>
						<div class="team-info tc radius4px" data-team-id="" id="close-chat">
							<i class="icon icon-team-info"></i>
							<p>关闭</p>
						</div>
						<div class="video-info tc radius4px" data-team-id="" id="showNetcallVideoLink1">
							<i class="icon icon-team-info"></i>
							<p>视频通话</p>
						</div>
					</div>
					<div class="netcall-box" id="netcallBox">
						<div class="netcall-mask hide">
							<div class="netcallTip"></div>
						</div>
						<div class="top hide">
							<span class="transferAudioAndVideo switchToAudio" id="switchToAudio">切换音频</span>
							<span class="transferAudioAndVideo switchToVideo" id="switchToVideo">切换视频</span>
							<span class="fullScreenIcon toggleFullScreenButton" id="toggleFullScreenButton" title="切换全屏">&nbsp;</span>
						</div>
						<!-- p2p呼叫界面 -->
						<div class="netcall-calling-box hide">
							<img alt="用户头像" class="avatar">
							<div class="nick"></div>
							<div class="tip">等待对方接听...</div>
							<div class="op">
								<button id="callingHangupButton" class="netcall-button red">挂断</button>
							</div>
						</div>
						<!-- p2p视频界面 -->
						<div class="netcall-show-video hide">
							<div class="netcall-video-left">
								<div class="netcall-video-remote bigView">
									<div class="message"></div>
									<span class="switchViewPositionButton"></span>
								</div>
							</div>
							<div class="netcall-video-right">
								<div class="netcall-video-local smallView">
									<div class="message"></div>
									<span class="switchViewPositionButton"></span>
								</div>
								<div class="operation">
									<div class="control">
										<div class="microphone control-item">
											<div class="slider hide">
												<div class="txt">10</div>
												<input class="microSliderInput" id="microSliderInput1" type="range" min="0" max="10" step="1" value="10" data-orientation="vertical">
											</div>
											<span class="icon-micro"></span>
										</div>
										<div class="volume control-item">
											<div class="slider hide">
												<div class="txt">10</div>
												<input class="volumeSliderInput" id="volumeSliderInput1" type="range" min="0" max="10" step="1" value="10" data-orientation="vertical">
											</div>
											<span class="icon-volume"></span>
										</div>
										<div class="camera control-item">
											<span class="icon-camera"></span>
										</div>
									</div>
									<div class="op">
										<button class="hangupButton netcall-button red">挂断</button>
									</div>
									<div class="tip">00 : 00</div>
								</div>
							</div>
						</div>
						<!-- p2p音频界面 -->
						<div class="netcall-show-audio hide">
							<img alt="用户头像" class="avatar">
							<div class="nick">test</div>
							<div class="tip">00 : 00</div>
							<div class="control">
								<div class="microphone control-item ">
									<div class="slider hide">
										<div class="txt">10</div>
										<input class="microSliderInput" id="microSliderInput" type="range" min="0" max="10" step="1" value="10" data-orientation="vertical">
									</div>
									<span class="icon-micro"></span>
								</div>
								<div class="volume control-item">
									<div class="slider hide">
										<div class="txt">10</div>
										<input class="volumeSliderInput" id="volumeSliderInput" type="range" min="0" max="10" step="1" value="10" data-orientation="vertical">
									</div>
									<span class="icon-volume"></span>
								</div>
							</div>
							<div class="op">
								<button class="hangupButton netcall-button red">挂断</button>
							</div>

						</div>
						<!-- 多人音视频互动界面 -->
						<div class="netcall-meeting-box hide" id="netcallMeetingBox"></div>
						<!-- 被叫界面 -->
						<div class="netcall-becalling-box hide">
							<img alt="用户头像" class="avatar">
							<div class="nick"></div>
							<p id="becallingText" class="tip"></p>
							<div class="op">
								<div class="normal">
									<div class="checking-tip">检查插件中...
										<span class="netcall-icon-checking"></span>
									</div>
									<button class="netcall-button blue beCallingAcceptButton" id="beCallingAcceptButton">
										<span class="txt">接听</span>
										<span class="netcall-icon-checking"></span>
									</button>
									<button class="netcall-button red beCallingRejectButton" id="beCallingRejectButton">
										拒绝
									</button>
								</div>
								<div class="exception">
									<button class="netcall-button blue" id="downloadAgentButton">下载音视频插件</button>
									<br/>
									<button class="netcall-button red beCallingRejectButton">拒绝</button>
									<div class="exception-tip">拒绝调用插件申请会导致无法唤起插件,需重启浏览器</div>
								</div>
							</div>
						</div>
						<div class="dialogs hide">
						</div>
					</div>
					<div id="whiteboard"></div>
					<div class="chat-content box-sizing" id="chatContent">
						<!-- 聊天记录 -->
					</div>
					<div class="u-chat-notice">您已退出</div>
					<div class="chat-mask"></div>
					<div class="chat-editor box-sizing" id="chatEditor" data-disabled="1">
						<div id="emojiTag" class="m-emojiTag"></div>
						<a class="chat-btn u-emoji" id="showEmoji"></a>
						<span class="chat-btn msg-type" id="chooseFileBtn">
							<a class="icon icon-file" data-type="file"></a>
						</span>
						<a class="chat-btn u-netcall-audio-link" id="showNetcallAudioLink">&nbsp;</a>
						<a class="chat-btn u-netcall-video-link" id="showNetcallVideoLink">&nbsp;</a>
						<!-- 在netcall_ui.js的fn.whenOpenChatBox中隐藏 -->
						<a class="chat-btn u-whiteboard" id="showWhiteboard">&nbsp;</a>
						<textarea id="messageText" class="chat-btn msg-input box-sizing radius5px p2p" rows="1" autofocus="autofocus" maxlength="500"></textarea>
						<span class="chat-context" id="showTeamMsgReceipt">
							<label for="needTeamMsgReceipt">
							<input id="needTeamMsgReceipt" type="checkbox" name="needTeamMsgReceipt" />回执</label>
						</span>
						<a class="btn-send radius5px" id="sendBtn">发送</a>
						<form action="#" id="uploadForm">
							<input multiple="multiple" type="file" name="file" id="uploadFile" class="hide" />
						</form>
					</div>
				</div>
			</div>
			<!-- <div class="right-panel hide radius5px devices-container" id="devices">
				  设备管理面板
				<div class="info-box">
					<div class="title tc">
						<button class="btn back-btn radius5px" id="backBtn2">返回</button>多端登录管理
					</div>
					<div class="content">
						<div class="main">
							<div class="pic"></div>
							<div class="mobile hide">
								<p>循一堂手机版</p>
								<a class="u-kick j-kickMoblie">下线</a>
							</div>
							<div class="pc hide">
								<p>循一堂PC版</p>
								<a class="u-kick j-kickPc">下线</a>
							</div>
						</div>
					</div>
				</div>
			</div>			 -->
			<!-- 进入工作台简介 -->
			<div class="gzt_yfjj" id="bg-gzt_yfjj">

			</div>
			<button id="show-detail-btn" hidden></button>
			<button id="close-detail-btn" hidden></button>
			<!-- 最右侧信息 -->
			<div class="center-workshopright" id="my-workshopright">
				<div class="workshopright-center">
					<div class="jbxx-box">	
						<div class="jbxx">
							<ul>									
								<li>基本信息：</li>
							</ul>
						</div>
						<div class="jbxx-nr">
							<ul>									
								<li id="jiuzhenno">就诊编号：<span id="patientno">IK009821</span></li>
								<li id="jiuzhenname">姓名：<span id="patientname">张某某</span></li>
								<li id="jiuzhensex">性别：<span id="patientsex">男</span></li>
								<li id="jiuzhenage">年龄：<span id="patientage">53</span></li>
								<!-- <li id="jiuzhenhistory">病史：<span id="patienthistory"></span></li>
								<li class="shetai">当前舌苔照片：<img src="../images/2.jpg" id="patientimage" /></li> -->
							</ul>
						</div>
					</div>
					<!-- <div class="ywbl-box">
						<div class="ywbl">
							<ul>									
								<li>以往病例：</li>
							</ul>
						</div>
						<div class="ywbl-nr">
							<ul id="historycase">									
							</ul>
						</div>
					</div> -->
					<div class="zs-box">
						<div class="zs">
							<ul>									
								<li>就诊记录：&ensp; </li>
							</ul>
						</div>
						<div class="zs-nr">
							<textarea name="" id="main-zs" cols="45" rows="7"></textarea>
						</div>
					</div>
					<div class="zd-box">
						<div class="zd">
							<ul>									
								<li>辨病辨述：</li>
							</ul>
						</div>
						<div class="zd-nr">
							<textarea name="main-zd" id="" cols="45" rows="7"></textarea>
						</div>
					</div>
					<div class="yj-box">
						<!-- <div class="yj">
							<ul>									
								<li>处理意见：</li>
							</ul>
						</div>
						<div class="yj-nr">
							<textarea name="" id="main-yj" cols="45" rows="4"></textarea>
						</div> -->
						<div class="yj-button">
							<ul>
								<a><li id="kf" >开方</li></a>
								<!-- <a><li id="cz-bc-reset" class="cz-bc-class">重置</li></a> -->
								<a><li id="cz-bc-save" class="cz-bc-class">保存</li></a>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		
		<!-- <div class="asideBox">
			<div class="m-goWhiteboard hide">
				<span class="whiteboard-icon-state netcall-icon-state-audio"></span>
				<div class="nick"></div>
				<div class="tip"></div>
			</div>
			<div class="m-goNetcall hide">
				<span class="netcall-icon-state netcall-icon-state-audio"></span>
				<div class="nick">&nbsp;</div>
				<div class="tip">00 : 00</div>
			</div>
			<a href="javascript:void(0)" onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">
				<div class="u-goChartRoom"></div>
			</a>

		</div>  -->
		<!-- 群资料 -->
		<div class="team-info-container hide" id="teamInfoContainer"></div>
		<!-- 云记录 -->
		<div class="cloud-msg-container hide" id="cloudMsgContainer"></div>
		<!-- 群弹框 -->
		<div class="dialog-team-container radius5px hide" id="dialogTeamContainer"></div>
		<!-- 技术方案弹框 -->
		<div class="dialog-team-container radius5px hide" id="dialogCallMethod"></div>
		<!-- 黑名单 -->
		<div class="m-blacklist radius5px hide" id="blacklist">
			<div class="title box-sizing">
				黑名单
				<i class="icon icon-close j-close"></i>
			</div>
			<div class="notice">你不会接收到列表中联系人的任何消息</div>
			<ul class="f-cb list">
				<li class="items f-cb">
					<img src="images/default-icon.png" class="head">
					<span class="nick">未知</span>
					<button class="btn radius4px btn-ok j-rm">解除</button>
				</li>
			</ul>
		</div>
		<!-- 消息中心 -->
		<div class="m-notice radius5px hide" id="notice">
			<div class="title box-sizing">
				消息中心
				<i class="icon icon-close j-close"></i>
				<b class="j-rmAllSysNotice rmAll"></b>
			</div>
			<ul class="tab f-cb">
				<li class="crt" data-value="sys">系统通知</li>
				<li data-value="other">自定义通知</li>
			</ul>
			<div class="content j-sysMsg">
			</div>
			<div class="content j-customSysMsg hide">
			</div>
		</div>
		<!-- 搜索高级群 -->
		<div class="m-dialog hide" id="searchTeamBox">
			<div class="title box-sizing">
				搜索高级群
				<i class="icon icon-close j-close"></i>
			</div>
			<div class="content tc">
				<input type="text" class="ipt radius5px box-sizing j-account" placeholder="请输入群id" />
				<div class="info f-cb">
					<img src="images/advanced.png">
					<div class="desc">
						<p class="j-name"></p>
						<p>
							<span class="j-teamId"></span>
						</p>
					</div>
				</div>
			</div>
			<div class="btns tc">
				<button class="btn btn-cancel radius4px cancel j-close">取消</button>
				<button class="btn btn-ok radius4px search j-search">确定</button>
				<button class="btn btn-cancel radius4px back j-back">继续搜索</button>
				<button class="btn btn-ok radius4px add j-add">申请加入</button>
				<button class="btn btn-ok radius4px chat j-chat">聊天</button>
			</div>
		</div>
	</div>
	<br>
	<br>
	<br>
	<div class="footer tc" style="padding:0px">
		<p>版权所有 © 2018-2020 北京循一堂健康管理有限公司&nbsp;&nbsp;&nbsp;技术支持电话：010-62084321</p>
	</div>


	<script>
		window.sessionid=localStorage.getItem("sessionid");
		var medArray=new Array();
		var med1Array=new Array();
		$("#kf").click(function(){
			if(null!=window.sessionid && window.sessionid.length>0){
				ymPrompt.setDefaultCfg({titleBar:false,maskAlphaColor:'#00f'});
				var tempurl =window.baseUrl;
				tempurl =tempurl.substring(0,tempurl.length-4);
				if(tempurl.indexOf('192.168')>=0) tempurl='http://localhost:';
				ymPrompt.win({message: tempurl+'8182/xunyitang/im/main-show.html',width:1400,height:800,title:'',handler:function()
				{},maxBtn:true,minBtn:true,iframe:true}) ;
			}else{
				window.location.href="../index.html";
			}

		})
		// $("#spell-name").on(" input propertychange",function(){
		// //alert($("#spell-name").val());
		// var keyword=$("#spell-name").val();
		// if(null==keyword || keyword.length==0) return;
		// $.ajax({
		// 			type: "POST",
		// 			url: window.baseUrl+"/xunyitang/westMedical/medicallist?jsessionid="+window.sessionid,
		// 			contentType: "application/x-www-form-urlencoded",
		// 			data:{keyword:keyword,type:"caoyao"},
		// 			dataType: "json",
		// 			async:false, 
		// 			beforeSend: function(request) {                
		// 				request.setRequestHeader("Token", localStorage.getItem("Authorization"));
		// 			},
		// 			success: function(data) {
		// 				if(null!=data&& null!=data.rows){
		// 					$("#caoyao-table").empty();
		// 					$("#caoyao-table").append('<tr><th width="198px" class="t-i10">药品名称</th><th width="66px">操作</th><th width="100px">类型</th><th width="60px">简拼</th><th width="68px" class="t-i10">规格</th><th width="62px">单价</th><th width="60px">单位</th></tr>');
		// 					for (let i = 0; i < data.rows.length; i++) {
		// 						var medical = data.rows[i];
		// 						$("#caoyao-table").append('<tr><td>'+medical.name+'</td><td><button data-id="'+medical.id+'" data-name="'+medical.name+'" data-dosage="'+medical.dosage+'" data-price="'+medical.price+'" type="button" class="add-2"></button></td><td>'+medical.type+'</td><td>'+medical.spell+'</td><td>'+medical.level+'</td>'+
		// 							'<td>'+medical.price+'</td><td>'+medical.dosage+'</td></tr>');
		// 					}
		// 					$(".add-2").click(function(){
		// 						var id = $(this).data().id;
		// 						var name=$(this).data().name;
		// 						var dosage=$(this).data().dosage;
		// 						var price =$(this).data().price;
		// 						$("#perscript-table").append('<tr><td>'+name+'</td><td>'+price+'</td><td><button class="xyt_kf_scyp" data-id="'+id+'"></button><span class="xyt_kf_ypgg">'+dosage+'</span><input class="xyt_kf_ylsr input-caoyao" value="1"></input></td></tr>');
		// 							medArray.push(id);
		// 							$(".xyt_kf_scyp").click(function(){
		// 								var tempid = $(this).data().id;
		// 								var index =medArray.indexOf(tempid);
		// 								if (index > -1) {
		// 									medArray.splice(index, 1);
		// 								}
		// 								$(this).parent().parent().remove();
		// 							});
		// 						})
		// 				}

		// 			},
		// 			error: function(data) {
		// 				window.location.href="../index.html";
		// 			}
		// 		});
		//});
		$("#spell-name-keli").on(" input propertychange",function(){
		//alert($("#spell-name").val());
		var keyword=$("#spell-name-keli").val();
		if(null==keyword || keyword.length==0) return;
		$.ajax({
					type: "POST",
					url: window.baseUrl+"/xunyitang/westMedical/medicallist?jsessionid="+window.sessionid,
					contentType: "application/x-www-form-urlencoded",
					data:{keyword:keyword,type:"keli"},
					dataType: "json",
					async:false, 
					beforeSend: function(request) {                
						request.setRequestHeader("Token", localStorage.getItem("Authorization"));
					},
					success: function(data) {
						if(null!=data&& null!=data.rows){
							$("#caoyao-table-keli").empty();
							$("#caoyao-table-keli").append('<tr><th width="30px">序号</th><th width="130px" class="t-i10">药品名称</th><th width="50px" class="t-i10">用量</th><th width="30px">单位</th><th width="180px">备注</th><th width="62px">单价</th><th width="60px">金额</th><th width="80px">操作</th></tr>');for (let i = 0; i < data.rows.length; i++) {
								var medical = data.rows[i];
								$("#caoyao-table-keli").append('<tr><td></td><td><input></input></td><td><input style="width: 50px;"></input></td><td>'+medical.dosage+'</td><td><input></input></td><td>'+medical.level+'</td>'+'<td>'+medical.price+'</td><td><button data-id="'+medical.id+'" data-name="'+medical.name+'" data-dosage="'+medical.dosage+'" data-price="'+medical.price+'" type="button" class="add-2"></button><button data-id="'+medical.id+'" data-name="'+medical.name+'" data-dosage="'+medical.dosage+'" data-price="'+medical.price+'" type="button" class="add-3"></button></td></tr>');
							}
							$(".add-2").click(function(){
									var id = $(this).data().id;
									var name=$(this).data().name;
									var dosage=$(this).data().dosage;
									var price =$(this).data().price;
									$("#perscript-table-keli").append('<tr><td><th>'+name+'</th><th>'+medical.spell+'</th></td></tr>');
									med1Array.push(id);
									$(".xyt_kf_scyp").click(function(){
									
										var tempid = $(this).data().id;
										var index =med1Array.indexOf(tempid);
										if (index > -1) {
											med1Array.splice(index, 1);
										}

										$(this).parent().parent().remove();
									});
								})
						}

					},
					error: function(data) {
						window.location.href="../index.html";
					}
				});
		})

		$(".search-name-input").keypress(function (e) {
            if (e.which == 13) {
				$(this).parent().parent().before('<tr><td></td><td><input></input></td><td><input style="width: 50px;"></input></td><td></td><td><input></input></td><td></td><td></td><td><button type="button" class="add-2"></button><button  type="button" class="add-3"></button></td></tr>');
            }	
		});
		$(".save-btn").click(function(){
			var numArr = []; // 定义一个空数组
			var txt = $('#perscript-table').find(':text'); // 获取所有文本框
			for (var i = 0; i < txt.length; i++) {
				numArr.push(txt.eq(i).val()); // 将文本框的值添加到数组中
			}
			console.info(numArr);

			var numArr1 = []; // 定义一个空数组
			var txt1 = $('#perscript-table-keli').find(':text'); // 获取所有文本框
			for (var i = 0; i < txt1.length; i++) {
				numArr1.push(txt1.eq(i).val()); // 将文本框的值添加到数组中
			}
			console.info(numArr1);

			var patientid= localStorage.getItem("sessionpatientid");
			var doctorid= localStorage.getItem("doctorId");
			$.ajax({
					type: "POST",
					url: window.baseUrl+"/xunyitang/westPrescriptMedical/savepermedlist?jsessionid="+window.sessionid,
					contentType: "application/x-www-form-urlencoded",
					data:{caoyaoids:medArray.join(","),caoyaocount:numArr.join(","),keliids:med1Array.join(","),kelicount:numArr1.join(","),patientid:patientid,doctorid:doctorid},
					dataType: "json",
					async:false, 
					beforeSend: function(request) {                
						request.setRequestHeader("Token", localStorage.getItem("Authorization"));
					},
					success: function(data) {

					},
					error: function(data) {
						window.location.href="../index.html";
					}
				});

			alert("保存成功");
		});
		$("#cz-bc-reset").click(function(){
			$("#main-zs").val("");
			$("#main-zd").val("");
			//$("#main-yj").val("");
		});
		$("#cz-bc-save").click(function(){
			var zhusu=$("#main-zs").val();
			var zhenduan=$("#main-zd").val();
			//var yijian=$("#main-yj").val();
			if (zhusu==""){
				alert("请输入就诊记录");
				return;
			}
			if(zhenduan==""){
				alert("请输入辨病辨述");
				return;
			}
			alert("保存成功");
			$("#main-zs").val("");
			$("#main-zd").val("");
		});

		 /*药方弹出框-点击弹出按钮*/
		 function xyt_kf_yfmb_popBox() {
        var xyt_kf_yfmb_popBox = document.getElementById("xyt_kf_yfmb_popBox");
        var xyt_kf_yfmb_popLayer = document.getElementById("xyt_kf_yfmb_popLayer");
        xyt_kf_yfmb_popBox.style.display = "block";
        xyt_kf_yfmb_popLayer.style.display = "block";
    };
 
    /*药方弹出框-点击关闭按钮*/
    function xyt_kf_yfmb_closeBox() {
        var xyt_kf_yfmb_popBox = document.getElementById("xyt_kf_yfmb_popBox");
        var xyt_kf_yfmb_popLayer = document.getElementById("xyt_kf_yfmb_popLayer");
        xyt_kf_yfmb_popBox.style.display = "none";
        xyt_kf_yfmb_popLayer.style.display = "none";
    }
	</script>
	</div>
	<!-- 退出确认框 -->
	<div class="dialog radius5px hide" id="logoutDialog">
		<span class="icon icon-close j-close"></span>
		<div class="content tc">确定要退出循一堂网页版吗？</div>
		<div class="buttons tc">
			<button class="btn radius4px btn-cancel j-close">取消</button>
			<button class="btn radius4px btn-ok j-ok">确定</button>
		</div>
	</div>
	<!-- 添加好友 -->
	<div class="m-dialog hide" id="addFriendBox">
		<div class="title box-sizing">
			添加好友
			<i class="icon icon-close j-close"></i>
		</div>
		<div class="content tc">
			<input type="text" class="ipt radius5px box-sizing j-account" placeholder="请输入帐号" />
			<div class="info f-cb">
				<img src="">
				<div class="desc">
					<p class="j-nickname"></p>
					<p>
						<span class="j-username"></span>
					</p>
				</div>
			</div>
			<div class="tip">
			</div>
		</div>
		<div class="btns tc">
			<button class="btn btn-cancel radius4px cancel j-close">取消</button>
			<button class="btn btn-ok radius4px search j-search">确定</button>
			<button class="btn btn-cancel radius4px back j-back">继续搜索</button>
			<button class="btn btn-ok radius4px add j-add">加为好友</button>
			<button class="btn btn-ok radius4px done j-close">完成</button>
			<button class="btn btn-ok radius4px chat j-chat">聊天</button>
			<button class="btn btn-del radius4px blacklist j-blacklist">移出黑名单</button>
		</div>
	</div>
	<!-- 人物信息 -->
	<div class="m-card hide" id="personCard">
		<i class="icon icon-close j-close"></i>
		<div class="uInfo f-cb">
			<img class="u-icon" src="">
			<div class="desc">
				<p class="j-nick nick">超级大饼</p>
				<img src="" class="j-gender gender">
				<p>
					<span class="j-username">帐号：caojidabin</span>
				</p>
				<p>
					<span class="j-nickname">昵称：caojidabin</span>
				</p>
			</div>
		</div>
		<div class="infos">
			<div class="items alias">
				<div class="item">备注名</div>
				<input type="text" class="e-alias ipt" maxlength="16">
				<a class="j-saveAlias save">保存</a>
			</div>
			<div class="items">
				<div class="item">生日</div>
				<div class="j-birth">1990-08-18</div>
			</div>
			<div class="items">
				<div class="item">手机</div>
				<div class="j-tel">18072912974</div>
			</div>
			<div class="items">
				<div class="item">邮箱</div>
				<div class="j-email">w8@173.com </div>
			</div>
			<div class="items">
				<div class="item">签名</div>
				<div class="j-sign sign">相信真善美,相信真善美相信真善美相信真善美,相信真善美,相信真善美,相信真善美,相信真善美,相信真善美</div>
			</div>
		</div>
		<ul>
			<li class="mutelist">消息提醒
				<div class="u-switch">
					<img src="images/btn_switch.png">
					<span class="off">off</span>
					<span class="on">on</span>
				</div>
			</li>
			<li class="blacklist">黑名单
				<div class="u-switch">
					<img src="images/btn_switch.png">
					<span class="off">off</span>
					<span class="on">on</span>
				</div>
			</li>
			<li class="mute hide" id="setTeamMute">设置禁言
				<div class="u-switch">
					<img src="images/btn_switch.png">
					<span class="off">off</span>
					<span class="on">on</span>
				</div>
			</li>
		</ul>
		<div class="btns tc">
			<button class="btn btn-del radius4px j-del del">删除好友</button>
			<button class="btn btn-cancel radius4px j-add add">加为好友</button>
			<button class="btn btn-ok radius4px j-chat chat">聊天</button>
		</div>
	</div>
	<!-- 个人信息 -->
	<div class="m-card m-card-1 hide" id="myInfo">
		<i class="icon icon-close j-close"></i>
		<div class="uInfo f-cb">
			<img class="u-icon modifyAvatar j-modifyAvatar" src="" alt="更换头像">
			<div class="desc">
				<p class="j-nickname nick">超级大饼</p>
				<img src="" class="j-gender gender">
				<p>
					<span class="j-username">帐号：caojidabin</span>
				</p>
			</div>
		</div>
		<div class="infos">
			<div class="operate">
				<span class="edit j-edit">编辑</span>
				<span class="save j-save">保存</span>
				<span class="cancel j-cancel"> 取消</span>
			</div>
			<div class="tt">基本信息</div>
			<div class="showUI">
				<div class="items">
					<div class="item">生日</div>
					<div class="j-birth">1990-08-18</div>
				</div>
				<div class="items">
					<div class="item">手机</div>
					<div class="j-tel">18072912974</div>
				</div>
				<div class="items">
					<div class="item">邮箱</div>
					<div class="j-email">w8@173.com </div>
				</div>
				<div class="items">
					<div class="item">签名</div>
					<div class="j-sign sign">相信真善美,相信真善美相信真善美相信真善美,相信真善美,相信真善美,相信真善美,相信真善美,相信真善美</div>
				</div>
			</div>
			<div class="editUI">
				<div class="items">
					<div class="item">昵称</div>
					<input type="text" class="e-nick ipt" maxlength="10">
				</div>
				<div class="items">
					<div class="item">性别</div>
					<select class="e-gender slt">
						<option value="unknown">不显示</option>
						<option value="male">男</option>
						<option value="female">女</option>
					</select>
				</div>
				<div class="items">
					<div class="item">生日</div>
					<input type="text" class="e-birth ipt" maxlength="20" id="datepicker">
				</div>
				<div class="items">
					<div class="item">手机</div>
					<input type="text" class="e-tel ipt ipt-1" maxlength="13">
				</div>
				<div class="items">
					<div class="item">邮箱</div>
					<input type="text" class="e-email ipt ipt-1" maxlength="30">
				</div>
				<div class="items">
					<div class="item">签名</div>
					<textarea class="e-sign" maxlength="30"></textarea>
				</div>
			</div>
		</div>
	</div>
	<!-- 修改头像 -->
	<div class="m-modifyAvatar hide" id="modifyAvatar">
		<i class="icon icon-close j-close"></i>
		<div class="choseFileCtn">
			<form action="#" class="j-uploadForm">
				<input type="file" class="j-upload" style="display: none;">
			</form>
			<div class="choseFile j-choseFile"> 选择图片</div>
		</div>
		<div class="tt">头像更换</div>
		<div class="chose" id="cropImg">
			<img src="" class="hide">
		</div>
		<div class="big">
			<div class="img">
				<img src="" class="hide">
			</div>
			<p>160*160</p>
		</div>
		<div class="small">
			<div class="img">
				<img src="" class="hide">
			</div>
			<p>40*40</p>
		</div>
		<div class="btns f-cb">
			<button class="f-fr btn btn-ok radius4px j-save">保存</button>
			<button class="f-fr btn btn-cancel radius4p j-reupload">重新选择</button>
			<button class="f-fr btn btn-cancel radius4p j-close">取消</button>
		</div>
	</div>
	<div id="mask" class="mask hide"></div>
	<script>
		// IE 11 polify
		if (!Object.assign) {
			Object.assign = function () {
				var list = arguments
				for (var i = 1; i < list.length; i++) {
					list[0] = extend(list[0], list[i])
				}
				return list[0]
			}

			function extend(obj1, obj2) {
				for (var i in obj2) {
					obj1[i] = obj2[i]
				}
				return obj1
			}
		}
	</script>
	<script src="../3rd/nim_server_conf.js"></script>
	<script src="../3rd/NIM_Web_SDK_v5.5.0.js"></script>
	<script src="../3rd/NIM_Web_Netcall_v5.5.0.js"></script>
	<script src="../3rd/NIM_Web_WebRTC_v5.5.0.js"></script>
	<script src="../3rd/NIM_Web_WhiteBoard_v5.5.0.js"></script>
	<script src="../3rd/DrawPlugin.js"></script>

	<script src="./js/3rd/whiteboard.js"></script>
	<!-- <script src="../3rd/jquery-1.11.3.min.js"></script> -->
	<!--<script src="../3rd/zepto.min.js"></script>-->
	<script>
		// FastClick.attach(document.body);
		window.onerror = function (errorMessage, source, lineno, colno, error) {
			var info = "错误信息：" + errorMessage + "\n" +
				"出错文件：" + source + "\n " +
				"出错行号：" + lineno + "\n" +
				"出错列号：" + colno + "\n" +
				"错误详情：" + error + "\n";

			// alert(JSON.stringify(ERROR));
			// ajax.postp(monitorUrl, ERROR, null, function(e){
			//     alert(e.stack);
			// });
			console.error(JSON.stringify(info));
			// ajax.post('/data/updateLog', ERROR);
			// alert(JSON.stringify(info))
			// minAlert.alert({
			// 	msg: JSON.stringify(info),
			// 	confirmBtnMsg: '好哒'
			// })
		}
	</script>

	<!-- <script src="../3rd/platform.js"></script> -->
	<script src="../3rd/rtcSupport.js"></script>
	<script src="js/3rd/jquery-ui.min.js"></script>
	<script src="../3rd/rangeslider.min.js"></script>
	<!-- 右键菜单-->
	<script src="js/3rd/contextMenu/jquery.ui.position.js"></script>
	<script src="js/3rd/contextMenu/jquery.contextMenu.js"></script>

	<script src="js/config.js"></script>
	<script src="js/emoji.js"></script>
	<script src="js/util.js?v=2"></script>
	<script src="js/cache.js?v=2"></script>
	<script src="js/link.js"></script>
	<script src="js/ui.js?v=2"></script>
	<script src="js/widget/uiKit.js?v=2"></script>
	<script src="js/widget/minAlert.js"></script>
	<script src="js/module/base.js"></script>
	<script src="js/module/message.js"></script>
	<script src="js/module/sysMsg.js"></script>
	<script src="js/module/personCard.js"></script>
	<script src="js/module/session.js"></script>
	<script src="js/module/friend.js"></script>
 
	<script src="js/module/team.js"></script>
	<script src="js/module/dialog_team.js"></script>
	<script src="js/module/cloudMsg.js"></script>
	<script src="js/module/notification.js"></script>
	<script src="js/module/netcall.js"></script>
	<script src="js/module/netcall_meeting.js"></script>
	<script src="js/module/netcall_ui.js"></script>
	<script src="js/module/dialog_call_method.js"></script>
	<script src="js/main.js?v=2"></script>
	<script src="../3rd/vue.min.js"></script>
	<script id="whiteboard-template" type="text/x-template">
		<div v-show="display" class="function-box whiteboard">
			<div v-if="banner.length" class="whiteboard-banner">
				<p>{{ banner }}</p>
			</div>
			<div v-if="tip.length" class="whiteboard-mask">
				<p>{{ tip }}</p>
			</div>
			<div v-if="bottomTip.length" class="whiteboard-bottom-tip">
				<p>{{ bottomTip }}</p>
			</div>
			<!-- P2P呼叫界面 -->
			<div v-if="!connected && isCalling">
				<img :src="avatar || 'images/default-icon.png'" alt="用户头像" class="avatar">
				<div class="nick">{{ nick }}</div>
				<div class="tip">{{ this.statusTip || '正在邀请对方，请稍候...' }} </div>
				<div class="op">
					<button @click="hangup" class="pure-button hangup">取消</button>
				</div>
			</div>
			<!-- P2P被叫界面 -->
			<div v-if="!connected && isCalled">
				<img :src="avatar || 'images/default-icon.png'" alt="用户头像" class="avatar">
				<div class="nick">{{ nick }}</div>
				<div class="tip">{{ this.statusTip || '邀请你进行白板互动' }}</div>
				<div v-if="needAgent" class="op download">
					<div>
						<button @click="downloadAgent" class="pure-button accept">下载插件</button>
					</div>
					<div>
						<button @click="reject" class="pure-button hangup">拒绝</button>
					</div>
					<div>
						<p>拒绝调用插件申请会导致无法唤起插件</p>
						<p>需重启浏览器</p>
					</div>
				</div>
				<div v-else class="op">
					<button @click="accept" class="pure-button accept">
						<span v-if="!waiting">接受</span>
						<span v-else class="netcall-icon-checking"></span>
					</button>
					<button @click="reject" class="pure-button hangup">拒绝</button>
				</div>
			</div>
			<!-- P2P白板界面 -->
			<div v-show="connected" class="whiteboard-ui pure-g">
				<div ref="container" class="pure-u-1-2 whiteboard-container"></div>
				<div class="pure-u-1-2 control-panel">
					<div class="pure-g btns">
						<div class="pure-u-1-3 control-btn">
							<div class="btn-tip">撤销</div>
							<span @click="undo" class="icon-undo"></span>
						</div>
						<div class="pure-u-1-3 control-btn">
							<div class="btn-tip">清除全部笔迹</div>
							<span @click="clear" class="icon-clear"></span>
						</div>
						<div class="pure-u-1-3 control-btn">
							<div v-if="!canWeUseMicro" class="alert-icon">!</div>
							<div v-if="!canWeUseMicro" class="btn-tip">麦克风不可用</div>
							<div v-else-if="isMicroOpen" class="btn-tip">关闭己方语音</div>
							<div v-else class="btn-tip">开启己方语音</div>
							<span @click="switchAudio" class="icon-mic" :class="{ 
								close: !isMicroOpen,
								disable: !canWeUseMicro
							}"></span>
						</div>
					</div>
					<button @click="hangup" class="pure-button hangup">结束</button>
				</div>
			</div>
			<div class="dialogs"></div>
		</div>
	</script>
	<script src="js/module/whiteboard.js"></script>
	<script type="text/javascript">
        window.baseUrl = localStorage.getItem("baseUrl");
        window.moreSearch = "";
        console.log(localStorage.getItem("Authorization"));
        jQuery(document).ready(function ($) {
            $(".notice").slide({
            titCell: ".tab-hd li",
            mainCell: ".tab-bd",
            delayTime: 0
			});
            $('#contentDiv').find('li').each(function () {
                $(this).click(function () {
                    var index=$(this).index();
                        if(index==0){
                            window.location.href="../patientlibrary.html";
                        }else if(index==1){
                            window.location.href="../appointlist.html";
                        }else if(index==2){
                            window.location.href="../medicallibrary.html";
                        }else if(index==3){
                            window.location.href="../workplan.html";
                        }else if(index==4){
                            window.location.href="../medicalservice.html";
                        }else if(index==5){//当前页面

                        }else if(index==6){
                            
                        }else if(index==7){

                        }else if(index==8){

                        }else if(index==9){
							
                        }
                })
            });

            $('#datetimepicker').datetimepicker({
                format: "YYYY-MM-DD HH:MM:SS"
            });

            var $table = $('#userTable');
            var $remove = $('#btn_delete'),
                $add = $('#btn_add'),
                $edit = $('#btn_edit'),
                toolbar = "#userToolbar";

            $table.bootstrapTable({
                contentType: "application/x-www-form-urlencoded",
                method: "post",
                toolbar: toolbar,
                showRefresh: true,
                showToggle: true,
                pagination: true,
                showColumns: true,
                idField: "id",
                sortName: 'createtime',
                sortOrder: 'desc',
                pageSize: 10,
                pageList: [10, 25, 50, 100],
                queryParamsType: "",
                queryParams: function (params) {
                    //将查询条件添加到查询参数中，分页或者刷新时将携带这些参数
                    params["moreSearch"] = window.moreSearch;
                    params["pageNumber"] = params.pageNumber;
                    params["pageSize"] = params.pageSize;
                    params["sortOrder"] = params.sortOrder;
                    params["sortName"] = params.sortName;
                    return params;
                },
                sidePagination: "server",
                url: window.baseUrl + "/article",
                columns: [
                    /* {field:"state",checkbox:true}, */
                    {
                        field: "id",
                        title: "编号"
                    },
                    {
                        field: "name",
                        title: "姓名",
                        sortable: true
                    },
                    {
                        field: "sex",
                        title: "性别",
                        sortable: true
                    },
                    {
                        field: "age",
                        title: "年龄",
                        sortable: true
                    },
                    {
                        field: "history",
                        title: "就医历史",
                        sortable: true
                    },
                    {
                        field: "diagnose",
                        title: "诊断",
                        sortable: true
                    },
                    {
                        field: "bumen",
                        title: "部门",
                        sortable: true
                    },
                    {
                        field: "opt",
                        title: "操作",
                        formatter: function (value, row) {
                            return '<button onclick="" class="b_ck fl"></button>' +
                                '<button onclick="" class="b_fxx fl"></button>' +
                                '<button onclick="" class="b_lh fl"></button>';
                        }
                    }

                ]
            });
            $table.on('check.bs.table uncheck.bs.table ' +
                'check-all.bs.table uncheck-all.bs.table',
                function () {
                    initBtnStatus();
                });

            //数据已添加到table中，onPostBody
            $table.on('post-body.bs.table', function (data) {
                initBtnStatus();
                //为按钮绑定事件
                $table.find(".detailBtn").click(function () {
                    window.open("http://hrfile.zcwjvr.com/file/down/" + $(this).data().id);
                });
            });
             //数据加载完成事件，onLoadSuccess
            $table.on('load-success.bs.table', function () {
                initBtnStatus();
            });

            function initBtnStatus() {
                var len = $table.bootstrapTable('getSelections').length;
                $remove.prop('disabled', !len);
                $edit.prop('disabled', len != 1);
            }

            function getFileIdSelections() {
                return $.map($table.bootstrapTable('getSelections'), function (row) {
                    return row.fileid
                });
            }

            function getIdSelections() {
                return $.map($table.bootstrapTable('getSelections'), function (row) {
                    return row.id
                });
            }
			$("#show-detail-btn").click(function(){
				var account= readCookie('uikit_account');
				var workshopright = document.getElementById("my-workshopright");
				var bg_gzt=document.getElementById("bg-gzt_yfjj");
				workshopright.style.display="block";
				bg_gzt.style.display="none";
				var patientid= localStorage.getItem("sessionpatientid");
				var doctorid= localStorage.getItem("doctorId");
				$.ajax({
					type: "POST",
					url: window.baseUrl+"/xunyitang/westPatient/patient?jsessionid="+window.sessionid,
					contentType: "application/x-www-form-urlencoded",
					data:{patientId:patientid},
					dataType: "json",
					async:false, 
					beforeSend: function(request) {                
						request.setRequestHeader("Token", localStorage.getItem("Authorization"));
					},
					success: function(data) {
						if(null!=data && null!=data.data){
							$("#patientno").html(data.data.id);
							$("#patientname").html(data.data.name);
							$("#nickName").html(data.data.name);
							$("#patientsex").html(data.data.sex);
							$("#patientage").html(data.data.age);
							$("#patienthistory").html(data.data.personalhistory);

							$("#kf-patientno").html(data.data.id);
							$("#kf-patientname").html(data.data.name);
							$("#kf-nickName").html(data.data.name);
							$("#kf-patientsex").html(data.data.sex);
							$("#kf-patientage").html(data.data.age);
							$("#kf-patienthistory").html(data.data.personalhistory);
						}

					},
					error: function(data) {
						window.location.href="index.html";
					}
				});

				$.ajax({
					type: "POST",
					url: window.baseUrl+"/xunyitang/westCase/caseList?jsessionid="+window.sessionid,
					contentType: "application/x-www-form-urlencoded",
					data:{patientId:patientid,doctorId:doctorid},
					dataType: "json",
					async:false, 
					beforeSend: function(request) {                
						request.setRequestHeader("Token", localStorage.getItem("Authorization"));
					},
					success: function(data) {
						if(null!=data && null!=data.rows && data.rows.length>0){
							for (let i = 0; i < data.rows.length; i++) {
								const element = data.rows[i];
								if(null!=element.createtime &&element.createtime.length>10){
									$("#historycase").append('<li class="">'+element.createtime.substring(0,10)+'就诊病历</li>');
								}
							}
						}

					},
					error: function(data) {
						window.location.href="../index.html";
					}
				});
			});
			$("#close-detail-btn").click(function(){
				var workshopright = document.getElementById("my-workshopright");
				var bg_gzt=document.getElementById("bg-gzt_yfjj");
				workshopright.style.display="none";
				bg_gzt.style.display="block";
				$("#rightPanel").addClass("hide");
			});
			$("#close-chat").click(function(){
				window.location.reload();
				localStorage.setItem("isSessionOpen","0");
			});
			function showDetail(userid){
				$(".center-workshopright").show();
				console.log("userid:"+userid);

			}
            $add.click(function () {
                window.location.href = "/jianliAdd";
            });

            $edit.click(function () {
                $.map($table.bootstrapTable('getSelections'), function (row) {
                    $("#userName").val(row.uname);
                    $("#userSex").val(row.usex);
                    $("#userAge").val(row.xueli);
                    $("#userJob").val(row.roll);
                    $("#userBumen").selectpicker('val', row.bumen);
                    $("#userChannel").val(row.fro);
                    $("#userTime").val(row.disptime);
                    $("#userAttention").val(row.focus_member);
                    $('#userStatus').selectpicker('val', row.zhuangtai);
                    $("#userMemo").val(row.memo);
                    $("#datetimepicker").val(row.meettime);
                });

            });
            $("#saveBtn").click(function () {
                var ids = getIdSelections();
                var userStatus = $('#userStatus').val();
                var userMemo = $('#userMemo').val();
                var userInfo = $('#userInfo').val();
                var userBumen = $('#userBumen').val();
                var meettime = $("#datetimepicker").val();
                $.ajax({
                    url: "/updateJianli?id=" + ids[0] + "&status=" + userStatus + "&memo=" +
                        userMemo + "&bumen=" + userBumen + "&meettime=" + meettime,
                    type: "GET",
                    success: function (result) {
                        if (result.success == true) {
                            sweetAlert('更新成功');
                            refresh();
                        } else {
                            sweetAlert('更新失败,请重试!');
                            refresh();
                        }
                    }
                });
            });
            $("#editPwdBtn").click(function () {
                var pwd = $("#newpwd").val();
                var pwd2 = $("#newpwd2").val();

                if (pwd == "") {
                    alert("密码不能为空");
                    return false;
                }
                if (pwd2 == "") {
                    alert("密码不能为空");
                    return false;
                }
                if (pwd != pwd2) {
                    alert("两次密码不一致");
                    return false;
                }
                $.ajax({
                    url: "/modifypwd?pid=${member.member_id}&pname=${member.username}&newpwd=" +
                        pwd,
                    type: "GET",
                    success: function (result) {
                        sweetAlert('更新成功');
                    }
                });
            });
            //刷新并跳转到第一页页面
            function refresh() {
                //刷新并跳转到第一页
                $table.bootstrapTable('selectPage', 1);
                //$table.bootstrapTable('refresh');
            };
            $("#btn_query").click(function () {
                window.searchName = $("#searchName").val();
                window.searchFocus = $("#searchFocus").val();
                window.searchSex = $("#searchSex").val();
                window.searchFrom = $("#searchFrom").val();
                window.searchTo = $("#searchTo").val();
                window.searchJob = $("#searchJob").val();
                window.searchChannel = $("#searchChannel").val();
                window.searchStatus = $("#searchStatus").val();
                window.searchBumen = $("#searchBumen").val();
                refresh();
            });
            $("#btn_more_query").click(function () {
                window.moreSearch = $("#moreSearch").val();
                refresh();
			});

        });
    </script>
</body>

</html>